package com.briup.sms.service.impl;

import com.briup.sms.dao.OrderMapper;
import com.briup.sms.entity.Order;
import com.briup.sms.service.OrderService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author :xuyang
 * @DateTime:2024/1/11 21:24
 * @Version :v1.0.0
 * ClassName:OrderServiceImpl
 * Package  :com.briup.sms.service.impl
 * Description:TODO
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    OrderMapper mapper;

    //    分页查询订单信息
    @Override
    public PageInfo<Order> getOrderInfo(String orderId, Boolean status, Integer pageSize, Integer pageNum) {
        List<Order> List = mapper.getOrderInfo(orderId, status);
        PageInfo<Order> pageInfo = new PageInfo<>(List);
        return pageInfo;
    }

    @Override
    public void updateOrder(Order order) {
        //修改订单
        mapper.updateOrder(order);
    }

    @Override
    public Order getOrder(String id) {
        //根据订单id查用户信息
        return mapper.findUserById(id);
    }
}

